import {
    center,
    right,
    grid,
    input,
    button,
    search,
    header,
} from '@/css/DialogsCss.module.scss';
export default {
    title:'最新询价单',
    dialog:{
        size:'50%'
    },
    onMounted: [{
        action: 'set',
        target: '$widgets.form',
        field: 'value',
        value: '$params'
    }],
    items: [{
        region: 'center',
        span: 10,
        class: center,
        layout: 'vertical',
        items: [{
            layout: 'vertical',
            items: [{
                id: 'form',
                widget: 'form',
                layout: {
                    type:'gridform',
                    column:2
                },
                fields: [{
                    class: input,
                    itemId: 'code',
                    placeholder: '请输入自定义编号',
                    widget: 'text',
                    label: '编号',
                }, {
                    class: input,
                    itemId: 'name',
                    placeholder: '请输入标题',
                    widget: 'text',
                    label: '标题',
                }, {
                    itemId: 'state',
                    widget: 'radiogroup',
                    options: [{
                        value: 0,
                        text: '待处理'
                    }, {
                        value: 1,
                        text: '已处理'
                    }],
                    label: '状态',
                }, {
                    class: input,
                    itemId: 'goods',
                    placeholder: '请输入询价产品',
                    widget: 'text',
                    label: '询价产品',
                }, {
                    class: input,
                    itemId: 'supplier',
                    placeholder: '请输入供应商',
                    widget: 'text',
                    label: '供应商',
                }, {
                    class: input,
                    itemId: 'amount_total',
                    placeholder: '请输入合计价格',
                    widget: 'text',
                    label: '合计价格',
                }, {
                    class: input,
                    itemId: 'include_tax',
                    placeholder: '请输入是否含税',
                    widget: 'text',
                    label: '是否含税',
                }, {
                    class: input,
                    itemId: 'include_invoice',
                    placeholder: '请输入是否含票',
                    widget: 'text',
                    label: '是否含票',
                }, {
                    class: input,
                    itemId: 'include_freight',
                    placeholder: '请输入是否含运费',
                    widget: 'text',
                    label: '是否含运费',
                }, {
                    class: input,
                    itemId: 'contacts',
                    placeholder: '请输入联系人',
                    widget: 'text',
                    label: '联系人',
                }, {
                    class: input,
                    itemId: 'phone',
                    placeholder: '请输入联系电话',
                    widget: 'text',
                    label: '联系电话',
                }, {
                    class: input,
                    itemId: 'address',
                    placeholder: '请输入地址',
                    widget: 'text',
                    label: '地址',
                }, {
                    class: input,
                    itemId: 'remarks',
                    placeholder: '请输入备注',
                    widget: 'text',
                    label: '备注说明',
                }],
                buttons: [{
                    value: '保存',
                    onClick: [{
                        action: 'confirm',
                        title: '表单保存',
                        message: '是否保存表单?',
                        confirm: [{
                            action: 'service',
                            path: 'saleManage/inquiry/latestInquirySheet/save',
                            params: '$widget.value',
                        }, {
                            action: 'message',
                            message: '保存成功',
                            type: 'success'
                        }, {
                            action: 'service',
                            path: 'saleManage/inquiry/latestInquirySheet/list',
                            params:{
                                page_size:'$widgets.grid.pageSize',
                                page_no:'$widgets.grid.page',
                                keywords: '$widgets.search.value.keywords',
                                is_show: '$widgets.search.value.is_show',
                            },
                            actions: [{
                                action:'set',
                                target:'$widgets.grid',
                                field:'value',
                                value:'$params.data.items'
                            },{
                                action:'set',
                                target:'$widgets.grid',
                                field:'total',
                                value:'$params.data.total'
                            }]
                        },{
                            action:'dialog-hide',
                            mode:'apply'
                        }]
                    }]
                }],
                flex: true
            }]
        }]
    }]
};


